package com.bjut.vendormgrsys.web.rest;

import com.bjut.vendormgrsys.web.dto.ResultInfo;
import com.bjut.vendormgrsys.web.dto.ResultList;
import com.bjut.vendormgrsys.web.dto.ResultStatusList;
import com.bjut.vendormgrsys.web.dto.Success;
import com.bjut.vendormgrsys.web.dto.systemNews.*;
import com.bjut.vendormgrsys.web.dto.user.Body;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;

@Validated
public interface SystemNewsApi {
    @Operation(summary = "创建新闻和修改", description = "创建新闻和修改", tags={ "SystemNews" })
    @ApiResponses(value = {
            @ApiResponse(responseCode = "200", description = "成功", content = @Content(schema = @Schema(implementation = Success.class))) })
    @RequestMapping(value = "/systemNews/create",
            produces = { "application/json;charset=UTF-8" },
            consumes = { "application/json;charset=UTF-8" },
            method = RequestMethod.POST)
    ResponseEntity<Success> systemNewsCreatePost(@Parameter(in = ParameterIn.DEFAULT, description = "", required=true, schema=@Schema()) @Valid @RequestBody SystemNewsInfo body);


    @Operation(summary = "获取新闻列表", description = "", tags={ "SystemNews" })
    @ApiResponses(value = {
            @ApiResponse(responseCode = "200", description = "获取新闻列表", content = @Content(schema = @Schema(implementation = ResultList.class))) })
    @RequestMapping(value = "/systemNews/findAll",
            produces = { "application/json;charset=UTF-8" },
            consumes = { "application/json;charset=UTF-8" },
            method = RequestMethod.POST)
    ResponseEntity<ResultList> systemNewsFindAllPost(@Parameter(in = ParameterIn.DEFAULT, description = "", schema=@Schema()) @Valid @RequestBody SystemNewsSearch body);

    @Operation(summary = "状态变更", description = "修改新闻状态", tags={ "SystemNews" })
    @ApiResponses(value = {
            @ApiResponse(responseCode = "200", description = "成功", content = @Content(schema = @Schema(implementation = Success.class))) })
    @RequestMapping(value = "/systemNews/changeStatus",
            produces = { "application/json;charset=UTF-8" },
            consumes = { "application/json;charset=UTF-8" },
            method = RequestMethod.POST)
    ResponseEntity<Success> changeStatusPost(@Parameter(in = ParameterIn.DEFAULT, description = "", schema=@Schema()) @Valid @RequestBody List<Body> body);

    @Operation(summary = "根据id获取新闻信息", description = "根据id获取新闻信息", tags={ "SystemNews" })
    @ApiResponses(value = {
            @ApiResponse(responseCode = "200", description = "成功", content = @Content(schema = @Schema(implementation = Success.class))) })
    @RequestMapping(value = "/systemNews/newsInfoById",
            produces = { "application/json;charset=UTF-8" },
            method = RequestMethod.GET)
    ResponseEntity<ResultInfo> systemNewsInfoByIdPost(@RequestParam String id);

    @Operation(summary = "状态统计", description = "状态统计", tags={ "SystemNews" })
    @ApiResponses(value = {
            @ApiResponse(responseCode = "200", description = "成功", content = @Content(schema = @Schema(implementation = Success.class))) })
    @RequestMapping(value = "/systemNews/statusList",
            method = RequestMethod.GET)
    ResponseEntity<ResultStatusList> statusListPost();

}
